package com.eonmind.vip.controller;


import com.eonmind.common.contract.data.response.ResponseEntity;
import com.eonmind.common.provider.entity.vip.UserWelfare;
import com.eonmind.common.security.annotations.UserInfo;
import com.eonmind.user.contract.dto.UserInfoData;
import com.eonmind.vip.dto.UserWelfareDto;
import com.eonmind.vip.service.ClockService;
import com.eonmind.vip.service.WelfareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户权益
 */
@RestController
@RequestMapping("/welfare")
public class UserWelfareController {

    @Autowired
    WelfareService welfareService;

    /**
     * 获取用户权益
     * @return ResponseEntity<UserWelfare>
     * @ignoreParams userInfoData
     */
    @GetMapping("/getUserWelfareInfo")
    @UserInfo
    public ResponseEntity<UserWelfareDto.UserWelfareResponse> userClock(UserInfoData userInfoData) {
        return welfareService.getWelfareInfo(userInfoData);
    }

    /**
     * 获取用户积分相关
     * @return ResponseEntity<UserWelfare>
     * @ignoreParams userInfoData
     */
    @GetMapping("/getUserPointsInfo")
    @UserInfo
    public ResponseEntity<UserWelfareDto.UserPointsResponse> userPoints(UserInfoData userInfoData) {
        return welfareService.getPointsInfo(userInfoData);
    }
}
